package edu.nf.api.controller.user;

import edu.nf.api.controller.BaseController;
import edu.nf.meituan.service.user.impl.UserServiceImpl;
import org.nf.web.annotation.RequestMapping;
import org.nf.web.annotation.RequestParam;
import org.nf.web.servlet.View;
import org.nf.web.servlet.view.JsonView;

/**
 * @Date 2023-06-20
 * @Author qiu
 * 用户注册控制器
 */
public class RegisterController extends BaseController {

    /**
     *
     * @param userName 用户名
     * @param pwd 密码
     * @param nickName 匿名
     * @param phone 手机号
     * @param key 验证码 -- 用户通过查看短信输入
     * @return
     */
    @RequestMapping("/user/register")
    public View registerUser(@RequestParam("userName") String userName, @RequestParam("pwd") String pwd,
                             @RequestParam("nickName") String nickName, @RequestParam("phone") String phone,
                             @RequestParam("key") String key) {

        int row = new UserServiceImpl().registerUser(userName, pwd, nickName, phone, key);

        return new JsonView(row);
    }

}
